package com.lg.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.lg.annotation.LoggerMessage;
@Aspect
@Order(1)
@Component
public class LoggerAspect {

	@Pointcut(value="within(com.lg..*)")
	public void pointcut() {
		
	}
	@Before("within(com.lg..*)&&@annotation(logger)")
	public void before(JoinPoint joinPoint , LoggerMessage logger) {
		System.out.println("getModifiers"+joinPoint.getSignature().getModifiers());
		System.out.println("getDeclaringTypeName"+joinPoint.getSignature().getDeclaringTypeName());
		System.out.println("getDeclaringTypeName"+joinPoint.getSignature().getName());
		System.out.println("url"+logger.url());
		System.out.println("userName"+logger.userName());
		System.out.println("value"+logger.value());

	
	}
}
